<%@ page language="java"
	import="java.util.*,com.zhuozhengsoft.pageoffice.*"
	pageEncoding="utf-8"%>
<%
PageOfficeCtrl poCtrl=new PageOfficeCtrl(request);
//设置服务器页面
poCtrl.setServerPage(request.getContextPath()+"/poserver.zz");
//添加自定义按钮
poCtrl.addCustomToolButton("保存","Save()",1);
poCtrl.addCustomToolButton("关闭","CloseFile()",21);
//设置保存页面
poCtrl.setSaveFilePage("SaveFile.jsp");
//打开Word文档
poCtrl.webOpen("doc/test.doc",OpenModeType.docNormalEdit,"张佚名");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>XX文档系统</title>
    <!-- PageOffice.js文件一定要引用 -->
       <script type="text/javascript" src="../jquery.min.js"></script>
       <script type="text/javascript" src="../pageoffice.js"  id="po_js_main"></script>

</head>


<body>
    <script type="text/javascript">
        function Save() {
            document.getElementById("PageOfficeCtrl1").WebSave();
        }
        function CloseFile() {
            POBrowser.closeWindow();
        }
        
        function BeforeBrowserClosed(){    
            if (document.getElementById("PageOfficeCtrl1").IsDirty){
                if(confirm("提示：文档已被修改，是否继续关闭放弃保存 ？"))
                {
                    return  true;
                    
                }else{
                
                    return  false;
                }
	         	
            }
        }
        
    </script>

    <div style=" width:auto; height:700px;">
       <%=poCtrl.getHtmlCode("PageOfficeCtrl1")%>
    </div>

</body>
</html>

